package com.fezs.common.constants;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 自定义返回码
 *
 * @author admin
 */
@Getter
@AllArgsConstructor
public enum ErrorCode {

    SUCCESS("0", "成功"),

    // ========== 客户端错误段 ==========
    BAD_REQUEST("400", "请求参数不正确!"),
    UNAUTHORIZED("401", "账号未登录!"),
    FORBIDDEN("403", "没有该操作权限!"),
    NOT_FOUND("404", "请求未找到!"),
    METHOD_NOT_ALLOWED("405", "请求方法不正确!"),
    LOCKED("423", "请求失败，请稍后重试!"),
    TOO_MANY_REQUESTS("429", "请求过于频繁，请稍后重试!"),

    // ========== 服务端错误段 ==========
    INTERNAL_SERVER_ERROR("500", "系统异常!"),
    BUSINESS_ERROR("600", "业务异常!"),

    UNKNOWN("999", "未知错误!");

    private final String code;
    private final String message;

}
